package com.ztesoft.book.api.controller.sys;

import com.ztesoft.book.api.annotation.SysLog;
import com.ztesoft.book.common.utils.Result;
import com.ztesoft.book.core.sys.sysuser.dto.SysUserDTO;
import com.ztesoft.book.core.sys.sysuser.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description 用户控制类
 * @Author YangFan
 * @Date 2021-06-22 17:07
 */
@Slf4j
@RestController
@RequestMapping("/sys/user")
public class SysUserController {

    @Resource
    private SysUserService sysUserService;

    /**
     * 方法功能描述:
     * < 测试方法 >
     *
     * @return Result                        【返回值 注释说明】
     * @author YangFan
     * @date 2021-06-30 07:19
     */
    @SysLog("测试方法保存系统日志")
    @PostMapping("/test")
    public Result test() {
        SysUserDTO user = sysUserService.getShiroUser();
        return Result.success(user);
    }
}
